import {reactive} from "vue";
import useDepartStore from "@/store/departModule";
import {IModelRef, ISubmit} from './types'

export const useDepartList = async () => {
    const departStore = useDepartStore()
    await departStore.requestDepartListAction()
    return departStore.departList
}

export const modelRef = reactive<IModelRef>({
    "id": 0,
    "password": "****",
    "name": "",
    "age": 0,
    "gender": 1,
    "salary": 0,
    "create_time": "2020-05-05 09:00:52",
    "depart_id": ""
});
export const rulesRef = reactive({
    "name": [{
        required: true, message: '请输入姓名'
    }],
    "password": [{
        required: true, message: '请输入密码'
    }],
    "age": [{
        required: true, message: '请输入年龄'
    }],
    "gender": [{
        required: true, message: '请选择性别'
    }],
    "salary": [{
        required: true, message: '请输入薪资'
    }],
    "create_time": [{
        required: true, message: '请选择入职时间'
    }],
    "depart_id": [{
        required: true, message: '请输入部门id'
    }],
});
